/**
* Copyright 2009, Jethro Grassie, Creative Jar Technology Ltd (http://www.cjtech.co.uk)
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
**/

package com.adobe.cairngorm.business;

import com.adobe.cairngorm.CairngormError;
import com.adobe.cairngorm.CairngormMessageCodes;

import javafx.reflect.*;

import java.util.List;

public abstract class AbstractServices
{
    public abstract function register(serviceLocator:ServiceLocator):Void;

    public abstract function getService(name:String):Object;

    protected function getAccessors(serviceLocator:ServiceLocator):List
    {
        var local:FXLocal = new FXLocal();
        var context:FXLocal.Context = local.getContext();
        var objVal:FXLocal.ObjectValue = new FXLocal.ObjectValue(serviceLocator, context);
        var type:FXClassType = context.makeClassRef(serviceLocator.getClass());
        var variables:List = type.getVariables(false);
        return variables;
    }
}

